<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Calculates binomial coefficient</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.gmp-and.html">« gmp_and</a></li>
      <li style="float: right;"><a href="function.gmp-clrbit.html">gmp_clrbit »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.gmp.html">GMP 函数</a></li>
    <li>Calculates binomial coefficient</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.gmp-binomial" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmp_binomial</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.3.0, PHP 8)</p><p class="refpurpose"><span class="refname">gmp_binomial</span> &mdash; <span class="dc-title">Calculates binomial coefficient</span></p>

 </div>

  <div class="refsect1 description" id="refsect1-function.gmp-binomial-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_binomial</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.gmp.html" class="type GMP">GMP</a></span>|<span class="type">int</span>|<span class="type">string</span></span> <code class="parameter">$n</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$k</code></span>): <span class="type"><a href="class.gmp.html" class="type GMP">GMP</a></span></div>

  <p class="para rdfs-comment">
   Calculates the binomial coefficient C(n, k).
  </p>
 </div>



  <div class="refsect1 parameters" id="refsect1-function.gmp-binomial-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">n</code></dt>

     <dd>

      <p class="para"><span class="classname"><a href="class.gmp.html" class="classname">GMP</a></span> 对象或 <span class="type">int</span> ，或数字<span class="type">string</span>。</p>
     </dd>

    
    
     <dt>
<code class="parameter">k</code></dt>

     <dd>

      <p class="para">

      </p>
     </dd>

    
   </dl>

  </p>
 </div>


  <div class="refsect1 returnvalues" id="refsect1-function.gmp-binomial-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the binomial coefficient C(n, k).
  </p>
 </div>

 
 <div class="refsect1 errors" id="refsect1-function.gmp-binomial-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws <span class="classname"><a href="class.valueerror.html" class="classname">ValueError</a></span> if <code class="parameter">k</code> is negative.
   Prior to PHP 8.0.0, <strong><code>E_WARNING</code></strong> was issued instead.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.gmp-binomial-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       This function no longer returns <strong><code>false</code></strong> on failure.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


</div></div></div></body></html>